﻿@model LunchList.ViewModels.EventsViewModel
@{
    ViewBag.Title = "Index";
}

<div class="jumbotron">
    <h1>Active Directory Group Lunch Sign Up</h1>
    <p class="lead">This is where you can create an Event.</p>    
</div>

<div class="container">
        @using (Ajax.BeginForm("AddEvent", "Events", new AjaxOptions { UpdateTargetId = "EventListTable", InsertionMode = InsertionMode.Replace, HttpMethod = "POST" }))       
        {       
            @Html.ValidationSummary(false)
                <div class="col-xs-8">
                    <table class="table table-striped">
                    <tr>
                        <td>
                            Event Date : 
                            @Html.TextBoxFor(m => Model.EventDate, new
                                                   {
                                                       @class = "dateInput",
                                                       data_date_format = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern.ToLower()                                              
                                                   })
                        </td>
                        <td >
                            Event Name : @Html.TextBoxFor(m => m.EventName, "eventname", new
                                                   {
                                                       @class = "dateInput",
                                                   })

                        </td>  
                    </tr>
           
                </table>
            </div>
        
                <div class="col-md-push-4">
                    <button type="submit" class="btn btn-default">
                        <span class="glyphicon glyphicon-floppy-disk"></span> Create Event
                    </button>          
                </div>    
        }

        <div id="EventListTable">           
            @{  Html.RenderAction("GetEventList"); }
        </div>

</div>
